import logging

from pylons import request, response, session, tmpl_context as c, url
from pylons.controllers.util import abort, redirect
from portal.lib.email_sender import send_email
from portal.lib.base import BaseController, render

log = logging.getLogger(__name__)

class ContactController(BaseController):

    def index(self):
        # Return a rendered template
        #return render('/contact.mako')
        # or, return a string
        return render('/contact/contact.mako')
    
    
    def send_message(self):
        sender = "chrysalide06@orange.fr,bretagne.bastian@gmail.com"
         
        message = """
        From: %s
        Subject: %s
        %s 
        """ % (request.params.get('sender'), request.params.get('subject'), request.params.get('content'))
        
        send_email(message)
        return '1'
